<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css"/>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css"/>
	</head>
	<body>
	<div class="am-g">
		 {include file='../Common/hy_header.html'}
		 <div class="am-g">
			<br>
			<div class="am-u-md-10 am-u-end">
				<form class="am-form am-form-horizontal hy-js-form">
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">Code</label>
						<div class="am-u-sm-6">
							<input type="text" name="codes" id="codes" value="" placeholder="">
						</div>
						<div class="am-u-sm-3">
						</div>
					</div>
					<!--<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">卡券类型</label>
						<div class="am-u-sm-6">
							<input type="radio" value="1" checked="checked" name='type'> 成人门票
							<input type="radio" value="2" name="type"> 慈善专场门票
							<input type="radio" value="3" name="type"> 儿童或长者门票
						</div>
						<div class="am-u-sm-3">
						</div>
					</div>-->
					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<button type="button" onClick="cancelCode()" id="btn" class="am-btn am-btn-primary ">核销</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	  {include file='../Common/hy_footer.html'}
	<script type="text/javascript" src="{$_C.hy_path}js/editor/kindeditor.js"></script>
	<script type="text/javascript">
		var isSend = false;
		function cancelCode(){
			if(isSend){
				return fasle;
			}
			$("#btn").html("核销中...");
			var codes = $("#codes").val();
			if(codes==""||codes==undefined||codes==null){
				alert("请输入Code值");
				$("#btn").html("核销");
				return false;
			}
			var data = {
				codes:codes
			};
			var url = "index.php?g=admin&m=suipai&a=cancelCode";
			$.post(url,data,function(res){
				if(res.error==0){
					showMsg(res.content,res.error);
					$("#codes").val("");
					$("#btn").html("核销");
					isSend = false;
				}else{
					showMsg(res.content,res.error);
					$("#btn").html("核销");
					isSend = false;
				}
			},"json");
			
		}
		
	</script>
	</body>
</html>
